import domain
from params import *
+DAEMONIZE = 1
DEBUG = 1
class NotifierProtocol(protocol.Protocol):
else:
# Child
os.execl("/usr/sbin/xfrd", "xfrd")
-
- def start(self, trace=0):
- """Attempts to start the daemons.
- The return value is defined by the LSB:
- 0 Success
- 4 Insufficient privileges
- """
- xend_pid = self.cleanup_xend()
- xfrd_pid = self.cleanup_xfrd()
+ def daemonize(self):
+ if not DAEMONIZE: return
# Detach from TTY.
os.setsid()
os.open('/dev/null', os.O_RDWR)
os.dup(0)
os.dup(1)
+
+ def start(self, trace=0):
+ """Attempts to start the daemons.
+ The return value is defined by the LSB:
+ 0 Success
+ 4 Insufficient privileges
+ """
+ xend_pid = self.cleanup_xend()
+ xfrd_pid = self.cleanup_xfrd()
+
+ self.daemonize()
+
if self.set_user():
return 4
os.chdir("/")